package com.wt.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wt.dao.WithdrawOrderMapper;
import com.wt.pojo.WithdrawOrder;
import com.wt.service.WithdrawOrderService;
import com.wt.util.Pager;
import com.wt.util.Pagination;

@Service("WithdrawOrderService")
public class WithdrawOrderServiceImpl implements WithdrawOrderService{

	@Resource
	private WithdrawOrderMapper withdrawOrderMapper;
	
	@Override
	public Pagination<WithdrawOrder> findList(Long beginDate, Long endDate, Pager pager) {
		Pagination<WithdrawOrder> pagination = new Pagination<WithdrawOrder>();
		List<WithdrawOrder> list = withdrawOrderMapper.selectList(beginDate, endDate, pager.getStartIndex(), pager.getPageSize());
		long count = withdrawOrderMapper.findListCount(beginDate, endDate);
		pager.calcPageCount(count);
		pagination.setRecords(list);
		pagination.setPager(pager);
		return pagination;
	}

	@Override
	public WithdrawOrder getWithdrawOrder(Integer id) {
		// TODO Auto-generated method stub
		return withdrawOrderMapper.selectById(id);
	}

	@Override
	public int updateWithdraw(Integer id, Integer status, String remark) {
		// TODO Auto-generated method stub
		return withdrawOrderMapper.updateWithdraw( id,  status,  remark);
	}
	
	
}
